import request from '@/utils/request'

export function permissionList() {
    return request({
      url: '/business/project/permissionList',
      method: 'get',
    })
  }

  export function createProject(data) {
    return request({
      url: '/business/project/addOrUpdate',
      method: 'post',
      data
    })
  }
  
  export function list(params) {
    return request({
      url: '/business/project/list',
      method: 'get',
      params
    })
  }

  export function deleteProject(id) {
    return request({
      url: `/business/project/${id}`,
      method: 'delete',
    })
  }
  
  export function finish(projectId) {
    return request({
      url: `/business/project/finish/${projectId}`,
      method: 'get',
    })
  }
  
  export function detail(id) {
    return request({
      url: `/business/project/${id}`,
      method: 'get',
    })
  }

  export function projectList(projectId) {
    return request({
      url: `/business/project/projectList/${projectId}`,
      method: 'get',
    })
  }
  export function createList(projectId,params) {
    return request({
      url: `/business/project/createList/${projectId}`,
      method: 'get',
      params
    })
  }

  export function deleteList(id) {
    return request({
      url: `/business/project/deleteList/${id}`,
      method: 'delete',
    })
  }

  export function fileList(projectId,query) {
    return request({
      url: `/business/project/fileList/${projectId}`,
      method: 'get',
      params:query
    })
  }
  
  export function fileCreate(data) {
    return request({
      url: `/business/project/upload`,
      method: 'post',
      data
    })
  }


  export function deleteFile(id) {
    return request({
      url: `/business/project/deleteFile/${id}`,
      method: 'delete',
    })
  }

  export function fileTree(projectId,query) {
    return request({
      url: `/business/project/fileTree/${projectId}`,
      method: 'get',
      params:query
    })
  }

  export function updateFile(data) {
    return request({
      url: `/business/project/updateFile`,
      method: 'post',
      data
    })
  }
  export function collectProApi(type,projectId) {
    return request({
      url: `/business/project/follow/${type}/${projectId}`,
      method: 'get',
    })
  }

